#!/bin/bash

cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/..

export LD_LIBRARY_PATH=build/src/lib:/home/c.hetherington/lib:$LD_LIBRARY_PATH:build/src
if [ "$1" == "--debug" ]; then
    shift
    gdb --args build/src/tools/dcpomatic2_kdm_cli "$@"
elif [ "$1" == "--valgrind" ]; then
    shift
    valgrind --tool="memcheck" --leak-check=full --show-reachable=yes build/src/tools/dcpomatic2_kdm_cli "$@"
else
    build/src/tools/dcpomatic2_kdm_cli "$@"
fi
